# -*- coding: utf-8 -*-
# ㊎ Author : XMZ
# ㊍ Time : 2021/9/27 14:57
# ㊌ File : formula -> read.py
# ㊋ IDE :  PyCharm
# ㊏ 
import os
import sys
import configparser

self_path = os.path.dirname(os.path.abspath(__file__))
father_path = os.path.dirname(self_path)
parent_path = os.path.dirname(father_path)
sys.path.append(self_path)
sys.path.append(father_path)
sys.path.append(parent_path)
cf = configparser.RawConfigParser()
cf.read(os.path.join(self_path, 'config.ini'), encoding="utf-8")


# 获取配置的方法
def cfs(key, value):
    """
    key:配置项名 列：mysql
    value：配置项的key 列: HOST
    return: 配置项的value 列: 127.0.0.1
    """
    return cf.get(key, value)
